﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WinterKiosk
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        Button _returnButton = new Button();

        public MainWindow()
        {
#if DEBUG
#else
            // hide the cursor when deployed
            this.Cursor = Cursors.None;
#endif

            InitializeComponent();

            for (int i = 0; i < 3; i++)
            {
                Button b = new Button();
                b.Height = 60;
                b.Margin = new Thickness(0, 0, 0, 20);

                if (i == 0)
                {
                    b.Content = "History";
                    b.Click += new RoutedEventHandler(history_click);
                }
                else if (i == 1)
                {
                    b.Content = "Fountain Images";
                    b.Click += new RoutedEventHandler(fountain_click);
                }
                else if (i == 2)
                {
                    b.Content = "Today";
                    b.Click += new RoutedEventHandler(today_click);
                }

                navPannel.Children.Add(b);
                Grid.SetColumn(b, 0);
                Grid.SetRow(b, 1);                
            }

            _returnButton.Height = 60;
            _returnButton.Content = "Return to home";
            navPannel.Children.Add(_returnButton);
            Grid.SetColumn(_returnButton, 0);
            Grid.SetRow(_returnButton, 1);
            _returnButton.Click += new RoutedEventHandler(return_click);
            _returnButton.Visibility = System.Windows.Visibility.Hidden;
            contentFrame.NavigationUIVisibility = NavigationUIVisibility.Hidden;
        }

        void return_click(object sender, RoutedEventArgs e)
        {
            contentFrame.Content = null;
            _returnButton.Visibility = System.Windows.Visibility.Hidden;
        }

        void today_click(object sender, RoutedEventArgs e)
        {
            Today t = new Today();
            contentFrame.Content = t;
            _returnButton.Visibility = System.Windows.Visibility.Visible;
        }

        void fountain_click(object sender, RoutedEventArgs e)
        {
            Fountain f = new Fountain();
            contentFrame.Content = f;
            _returnButton.Visibility = System.Windows.Visibility.Visible;            
        }

        void history_click(object sender, RoutedEventArgs e)
        {
            History h = new History();
            contentFrame.Content = h;            
            _returnButton.Visibility = System.Windows.Visibility.Visible;
        }
    }
}
